Optimal. Leaf size=182 \[ -\frac {b^2 d^2 x}{4 f^2}+\frac {a^2 (c+d x)^3}{3 d}-\frac {b^2 (c+d x)^3}{6 d}+\frac {4 a b d^2 \cosh (e+f x)}{f^3}+\frac {2 a b (c+d x)^2 \cosh (e+f x)}{f}-\frac {4 a b d (c+d x) \sinh (e+f x)}{f^2}+\frac {b^2 d^2 \cosh (e+f x) \sinh (e+f x)}{4 f^3}+\frac {b^2 (c+d x)^2 \cosh (e+f x) \sinh (e+f x)}{2 f}-\frac {b^2 d (c+d x) \sinh ^2(e+f x)}{2 f^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.14, antiderivative size = 182, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 7, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.350, Rules used = {3398, 3377,
2718, 3392, 32, 2715, 8} \begin {gather*} \frac {a^2 (c+d x)^3}{3 d}-\frac {4 a b d (c+d x) \sinh (e+f x)}{f^2}+\frac {2 a b (c+d x)^2 \cosh (e+f x)}{f}+\frac {4 a b d^2 \cosh (e+f x)}{f^3}-\frac {b^2 d (c+d x) \sinh ^2(e+f x)}{2 f^2}+\frac {b^2 (c+d x)^2 \sinh (e+f x) \cosh (e+f x)}{2 f}-\frac {b^2 (c+d x)^3}{6 d}+\frac {b^2 d^2 \sinh (e+f x) \cosh (e+f x)}{4 f^3}-\frac {b^2 d^2 x}{4 f^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 32
Rule 2715
Rule 2718
Rule 3377
Rule 3392
Rule 3398
Rubi steps
\begin {align*} \int (c+d x)^2 (a+b \sinh (e+f x))^2 \, dx &=\int \left (a^2 (c+d x)^2+2 a b (c+d x)^2 \sinh (e+f x)+b^2 (c+d x)^2 \sinh ^2(e+f x)\right ) \, dx\\ &=\frac {a^2 (c+d x)^3}{3 d}+(2 a b) \int (c+d x)^2 \sinh (e+f x) \, dx+b^2 \int (c+d x)^2 \sinh ^2(e+f x) \, dx\\ &=\frac {a^2 (c+d x)^3}{3 d}+\frac {2 a b (c+d x)^2 \cosh (e+f x)}{f}+\frac {b^2 (c+d x)^2 \cosh (e+f x) \sinh (e+f x)}{2 f}-\frac {b^2 d (c+d x) \sinh ^2(e+f x)}{2 f^2}-\frac {1}{2} b^2 \int (c+d x)^2 \, dx+\frac {\left (b^2 d^2\right ) \int \sinh ^2(e+f x) \, dx}{2 f^2}-\frac {(4 a b d) \int (c+d x) \cosh (e+f x) \, dx}{f}\\ &=\frac {a^2 (c+d x)^3}{3 d}-\frac {b^2 (c+d x)^3}{6 d}+\frac {2 a b (c+d x)^2 \cosh (e+f x)}{f}-\frac {4 a b d (c+d x) \sinh (e+f x)}{f^2}+\frac {b^2 d^2 \cosh (e+f x) \sinh (e+f x)}{4 f^3}+\frac {b^2 (c+d x)^2 \cosh (e+f x) \sinh (e+f x)}{2 f}-\frac {b^2 d (c+d x) \sinh ^2(e+f x)}{2 f^2}+\frac {\left (4 a b d^2\right ) \int \sinh (e+f x) \, dx}{f^2}-\frac {\left (b^2 d^2\right ) \int 1 \, dx}{4 f^2}\\ &=-\frac {b^2 d^2 x}{4 f^2}+\frac {a^2 (c+d x)^3}{3 d}-\frac {b^2 (c+d x)^3}{6 d}+\frac {4 a b d^2 \cosh (e+f x)}{f^3}+\frac {2 a b (c+d x)^2 \cosh (e+f x)}{f}-\frac {4 a b d (c+d x) \sinh (e+f x)}{f^2}+\frac {b^2 d^2 \cosh (e+f x) \sinh (e+f x)}{4 f^3}+\frac {b^2 (c+d x)^2 \cosh (e+f x) \sinh (e+f x)}{2 f}-\frac {b^2 d (c+d x) \sinh ^2(e+f x)}{2 f^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.43, size = 249, normalized size = 1.37 \begin {gather*} \frac {24 a^2 c^2 f^3 x-12 b^2 c^2 f^3 x+24 a^2 c d f^3 x^2-12 b^2 c d f^3 x^2+8 a^2 d^2 f^3 x^3-4 b^2 d^2 f^3 x^3+48 a b \left (c^2 f^2+2 c d f^2 x+d^2 \left (2+f^2 x^2\right )\right ) \cosh (e+f x)-6 b^2 d f (c+d x) \cosh (2 (e+f x))-96 a b c d f \sinh (e+f x)-96 a b d^2 f x \sinh (e+f x)+3 b^2 d^2 \sinh (2 (e+f x))+6 b^2 c^2 f^2 \sinh (2 (e+f x))+12 b^2 c d f^2 x \sinh (2 (e+f x))+6 b^2 d^2 f^2 x^2 \sinh (2 (e+f x))}{24 f^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(534\) vs.
\(2(170)=340\).
time = 0.82, size = 535, normalized size = 2.94
method | result | size |
risch | \(\frac {d^{2} a^{2} x^{3}}{3}-\frac {d^{2} b^{2} x^{3}}{6}+a^{2} c d \,x^{2}-\frac {d \,b^{2} c \,x^{2}}{2}+a^{2} c^{2} x -\frac {b^{2} c^{2} x}{2}+\frac {c^{3} a^{2}}{3 d}-\frac {b^{2} c^{3}}{6 d}+\frac {b^{2} \left (2 d^{2} x^{2} f^{2}+4 c d \,f^{2} x +2 c^{2} f^{2}-2 d^{2} f x -2 c d f +d^{2}\right ) {\mathrm e}^{2 f x +2 e}}{16 f^{3}}+\frac {a b \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}-2 d^{2} f x -2 c d f +2 d^{2}\right ) {\mathrm e}^{f x +e}}{f^{3}}+\frac {a b \left (d^{2} x^{2} f^{2}+2 c d \,f^{2} x +c^{2} f^{2}+2 d^{2} f x +2 c d f +2 d^{2}\right ) {\mathrm e}^{-f x -e}}{f^{3}}-\frac {b^{2} \left (2 d^{2} x^{2} f^{2}+4 c d \,f^{2} x +2 c^{2} f^{2}+2 d^{2} f x +2 c d f +d^{2}\right ) {\mathrm e}^{-2 f x -2 e}}{16 f^{3}}\) | \(315\) |
derivativedivides | \(\frac {\frac {d^{2} a^{2} \left (f x +e \right )^{3}}{3 f^{2}}+\frac {2 d^{2} a b \left (\left (f x +e \right )^{2} \cosh \left (f x +e \right )-2 \left (f x +e \right ) \sinh \left (f x +e \right )+2 \cosh \left (f x +e \right )\right )}{f^{2}}+\frac {d^{2} b^{2} \left (\frac {\left (f x +e \right )^{2} \cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {\left (f x +e \right )^{3}}{6}-\frac {\left (f x +e \right ) \left (\cosh ^{2}\left (f x +e \right )\right )}{2}+\frac {\cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{4}+\frac {f x}{4}+\frac {e}{4}\right )}{f^{2}}-\frac {d^{2} e \,a^{2} \left (f x +e \right )^{2}}{f^{2}}-\frac {4 d^{2} e a b \left (\left (f x +e \right ) \cosh \left (f x +e \right )-\sinh \left (f x +e \right )\right )}{f^{2}}-\frac {2 d^{2} e \,b^{2} \left (\frac {\left (f x +e \right ) \cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {\left (f x +e \right )^{2}}{4}-\frac {\left (\cosh ^{2}\left (f x +e \right )\right )}{4}\right )}{f^{2}}+\frac {d c \,a^{2} \left (f x +e \right )^{2}}{f}+\frac {4 d c a b \left (\left (f x +e \right ) \cosh \left (f x +e \right )-\sinh \left (f x +e \right )\right )}{f}+\frac {2 d c \,b^{2} \left (\frac {\left (f x +e \right ) \cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {\left (f x +e \right )^{2}}{4}-\frac {\left (\cosh ^{2}\left (f x +e \right )\right )}{4}\right )}{f}+\frac {d^{2} e^{2} a^{2} \left (f x +e \right )}{f^{2}}+\frac {2 d^{2} e^{2} a b \cosh \left (f x +e \right )}{f^{2}}+\frac {d^{2} e^{2} b^{2} \left (\frac {\cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {f x}{2}-\frac {e}{2}\right )}{f^{2}}-\frac {2 d e c \,a^{2} \left (f x +e \right )}{f}-\frac {4 d e c a b \cosh \left (f x +e \right )}{f}-\frac {2 d e c \,b^{2} \left (\frac {\cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {f x}{2}-\frac {e}{2}\right )}{f}+a^{2} c^{2} \left (f x +e \right )+2 c^{2} a b \cosh \left (f x +e \right )+b^{2} c^{2} \left (\frac {\cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {f x}{2}-\frac {e}{2}\right )}{f}\) | \(535\) |
default | \(\frac {\frac {d^{2} a^{2} \left (f x +e \right )^{3}}{3 f^{2}}+\frac {2 d^{2} a b \left (\left (f x +e \right )^{2} \cosh \left (f x +e \right )-2 \left (f x +e \right ) \sinh \left (f x +e \right )+2 \cosh \left (f x +e \right )\right )}{f^{2}}+\frac {d^{2} b^{2} \left (\frac {\left (f x +e \right )^{2} \cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {\left (f x +e \right )^{3}}{6}-\frac {\left (f x +e \right ) \left (\cosh ^{2}\left (f x +e \right )\right )}{2}+\frac {\cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{4}+\frac {f x}{4}+\frac {e}{4}\right )}{f^{2}}-\frac {d^{2} e \,a^{2} \left (f x +e \right )^{2}}{f^{2}}-\frac {4 d^{2} e a b \left (\left (f x +e \right ) \cosh \left (f x +e \right )-\sinh \left (f x +e \right )\right )}{f^{2}}-\frac {2 d^{2} e \,b^{2} \left (\frac {\left (f x +e \right ) \cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {\left (f x +e \right )^{2}}{4}-\frac {\left (\cosh ^{2}\left (f x +e \right )\right )}{4}\right )}{f^{2}}+\frac {d c \,a^{2} \left (f x +e \right )^{2}}{f}+\frac {4 d c a b \left (\left (f x +e \right ) \cosh \left (f x +e \right )-\sinh \left (f x +e \right )\right )}{f}+\frac {2 d c \,b^{2} \left (\frac {\left (f x +e \right ) \cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {\left (f x +e \right )^{2}}{4}-\frac {\left (\cosh ^{2}\left (f x +e \right )\right )}{4}\right )}{f}+\frac {d^{2} e^{2} a^{2} \left (f x +e \right )}{f^{2}}+\frac {2 d^{2} e^{2} a b \cosh \left (f x +e \right )}{f^{2}}+\frac {d^{2} e^{2} b^{2} \left (\frac {\cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {f x}{2}-\frac {e}{2}\right )}{f^{2}}-\frac {2 d e c \,a^{2} \left (f x +e \right )}{f}-\frac {4 d e c a b \cosh \left (f x +e \right )}{f}-\frac {2 d e c \,b^{2} \left (\frac {\cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {f x}{2}-\frac {e}{2}\right )}{f}+a^{2} c^{2} \left (f x +e \right )+2 c^{2} a b \cosh \left (f x +e \right )+b^{2} c^{2} \left (\frac {\cosh \left (f x +e \right ) \sinh \left (f x +e \right )}{2}-\frac {f x}{2}-\frac {e}{2}\right )}{f}\) | \(535\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 339, normalized size = 1.86 \begin {gather*} \frac {1}{3} \, a^{2} d^{2} x^{3} + a^{2} c d x^{2} - \frac {1}{8} \, {\left (4 \, x^{2} - \frac {{\left (2 \, f x e^{\left (2 \, e\right )} - e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{f^{2}} + \frac {{\left (2 \, f x + 1\right )} e^{\left (-2 \, f x - 2 \, e\right )}}{f^{2}}\right )} b^{2} c d - \frac {1}{48} \, {\left (8 \, x^{3} - \frac {3 \, {\left (2 \, f^{2} x^{2} e^{\left (2 \, e\right )} - 2 \, f x e^{\left (2 \, e\right )} + e^{\left (2 \, e\right )}\right )} e^{\left (2 \, f x\right )}}{f^{3}} + \frac {3 \, {\left (2 \, f^{2} x^{2} + 2 \, f x + 1\right )} e^{\left (-2 \, f x - 2 \, e\right )}}{f^{3}}\right )} b^{2} d^{2} - \frac {1}{8} \, b^{2} c^{2} {\left (4 \, x - \frac {e^{\left (2 \, f x + 2 \, e\right )}}{f} + \frac {e^{\left (-2 \, f x - 2 \, e\right )}}{f}\right )} + a^{2} c^{2} x + 2 \, a b c d {\left (\frac {{\left (f x e^{e} - e^{e}\right )} e^{\left (f x\right )}}{f^{2}} + \frac {{\left (f x + 1\right )} e^{\left (-f x - e\right )}}{f^{2}}\right )} + a b d^{2} {\left (\frac {{\left (f^{2} x^{2} e^{e} - 2 \, f x e^{e} + 2 \, e^{e}\right )} e^{\left (f x\right )}}{f^{3}} + \frac {{\left (f^{2} x^{2} + 2 \, f x + 2\right )} e^{\left (-f x - e\right )}}{f^{3}}\right )} + \frac {2 \, a b c^{2} \cosh \left (f x + e\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 262, normalized size = 1.44 \begin {gather*} \frac {2 \, {\left (2 \, a^{2} - b^{2}\right )} d^{2} f^{3} x^{3} + 6 \, {\left (2 \, a^{2} - b^{2}\right )} c d f^{3} x^{2} + 6 \, {\left (2 \, a^{2} - b^{2}\right )} c^{2} f^{3} x - 3 \, {\left (b^{2} d^{2} f x + b^{2} c d f\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )^{2} - 3 \, {\left (b^{2} d^{2} f x + b^{2} c d f\right )} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )^{2} + 24 \, {\left (a b d^{2} f^{2} x^{2} + 2 \, a b c d f^{2} x + a b c^{2} f^{2} + 2 \, a b d^{2}\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right ) - 3 \, {\left (16 \, a b d^{2} f x + 16 \, a b c d f - {\left (2 \, b^{2} d^{2} f^{2} x^{2} + 4 \, b^{2} c d f^{2} x + 2 \, b^{2} c^{2} f^{2} + b^{2} d^{2}\right )} \cosh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )\right )} \sinh \left (f x + \cosh \left (1\right ) + \sinh \left (1\right )\right )}{12 \, f^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 456 vs.
\(2 (177) = 354\).
time = 0.30, size = 456, normalized size = 2.51 \begin {gather*} \begin {cases} a^{2} c^{2} x + a^{2} c d x^{2} + \frac {a^{2} d^{2} x^{3}}{3} + \frac {2 a b c^{2} \cosh {\left (e + f x \right )}}{f} + \frac {4 a b c d x \cosh {\left (e + f x \right )}}{f} - \frac {4 a b c d \sinh {\left (e + f x \right )}}{f^{2}} + \frac {2 a b d^{2} x^{2} \cosh {\left (e + f x \right )}}{f} - \frac {4 a b d^{2} x \sinh {\left (e + f x \right )}}{f^{2}} + \frac {4 a b d^{2} \cosh {\left (e + f x \right )}}{f^{3}} + \frac {b^{2} c^{2} x \sinh ^{2}{\left (e + f x \right )}}{2} - \frac {b^{2} c^{2} x \cosh ^{2}{\left (e + f x \right )}}{2} + \frac {b^{2} c^{2} \sinh {\left (e + f x \right )} \cosh {\left (e + f x \right )}}{2 f} + \frac {b^{2} c d x^{2} \sinh ^{2}{\left (e + f x \right )}}{2} - \frac {b^{2} c d x^{2} \cosh ^{2}{\left (e + f x \right )}}{2} + \frac {b^{2} c d x \sinh {\left (e + f x \right )} \cosh {\left (e + f x \right )}}{f} - \frac {b^{2} c d \cosh ^{2}{\left (e + f x \right )}}{2 f^{2}} + \frac {b^{2} d^{2} x^{3} \sinh ^{2}{\left (e + f x \right )}}{6} - \frac {b^{2} d^{2} x^{3} \cosh ^{2}{\left (e + f x \right )}}{6} + \frac {b^{2} d^{2} x^{2} \sinh {\left (e + f x \right )} \cosh {\left (e + f x \right )}}{2 f} - \frac {b^{2} d^{2} x \sinh ^{2}{\left (e + f x \right )}}{4 f^{2}} - \frac {b^{2} d^{2} x \cosh ^{2}{\left (e + f x \right )}}{4 f^{2}} + \frac {b^{2} d^{2} \sinh {\left (e + f x \right )} \cosh {\left (e + f x \right )}}{4 f^{3}} & \text {for}\: f \neq 0 \\\left (a + b \sinh {\left (e \right )}\right )^{2} \left (c^{2} x + c d x^{2} + \frac {d^{2} x^{3}}{3}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 344 vs.
\(2 (170) = 340\).
time = 0.44, size = 344, normalized size = 1.89 \begin {gather*} \frac {1}{3} \, a^{2} d^{2} x^{3} - \frac {1}{6} \, b^{2} d^{2} x^{3} + a^{2} c d x^{2} - \frac {1}{2} \, b^{2} c d x^{2} + a^{2} c^{2} x - \frac {1}{2} \, b^{2} c^{2} x + \frac {{\left (2 \, b^{2} d^{2} f^{2} x^{2} + 4 \, b^{2} c d f^{2} x + 2 \, b^{2} c^{2} f^{2} - 2 \, b^{2} d^{2} f x - 2 \, b^{2} c d f + b^{2} d^{2}\right )} e^{\left (2 \, f x + 2 \, e\right )}}{16 \, f^{3}} + \frac {{\left (a b d^{2} f^{2} x^{2} + 2 \, a b c d f^{2} x + a b c^{2} f^{2} - 2 \, a b d^{2} f x - 2 \, a b c d f + 2 \, a b d^{2}\right )} e^{\left (f x + e\right )}}{f^{3}} + \frac {{\left (a b d^{2} f^{2} x^{2} + 2 \, a b c d f^{2} x + a b c^{2} f^{2} + 2 \, a b d^{2} f x + 2 \, a b c d f + 2 \, a b d^{2}\right )} e^{\left (-f x - e\right )}}{f^{3}} - \frac {{\left (2 \, b^{2} d^{2} f^{2} x^{2} + 4 \, b^{2} c d f^{2} x + 2 \, b^{2} c^{2} f^{2} + 2 \, b^{2} d^{2} f x + 2 \, b^{2} c d f + b^{2} d^{2}\right )} e^{\left (-2 \, f x - 2 \, e\right )}}{16 \, f^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.55, size = 281, normalized size = 1.54 \begin {gather*} a^2\,c^2\,x-\frac {b^2\,c^2\,x}{2}+\frac {a^2\,d^2\,x^3}{3}-\frac {b^2\,d^2\,x^3}{6}+\frac {b^2\,c^2\,\mathrm {sinh}\left (2\,e+2\,f\,x\right )}{4\,f}+\frac {b^2\,d^2\,\mathrm {sinh}\left (2\,e+2\,f\,x\right )}{8\,f^3}+a^2\,c\,d\,x^2-\frac {b^2\,c\,d\,x^2}{2}+\frac {2\,a\,b\,c^2\,\mathrm {cosh}\left (e+f\,x\right )}{f}+\frac {4\,a\,b\,d^2\,\mathrm {cosh}\left (e+f\,x\right )}{f^3}+\frac {b^2\,d^2\,x^2\,\mathrm {sinh}\left (2\,e+2\,f\,x\right )}{4\,f}-\frac {b^2\,c\,d\,\mathrm {cosh}\left (2\,e+2\,f\,x\right )}{4\,f^2}-\frac {b^2\,d^2\,x\,\mathrm {cosh}\left (2\,e+2\,f\,x\right )}{4\,f^2}-\frac {4\,a\,b\,c\,d\,\mathrm {sinh}\left (e+f\,x\right )}{f^2}-\frac {4\,a\,b\,d^2\,x\,\mathrm {sinh}\left (e+f\,x\right )}{f^2}+\frac {2\,a\,b\,d^2\,x^2\,\mathrm {cosh}\left (e+f\,x\right )}{f}+\frac {b^2\,c\,d\,x\,\mathrm {sinh}\left (2\,e+2\,f\,x\right )}{2\,f}+\frac {4\,a\,b\,c\,d\,x\,\mathrm {cosh}\left (e+f\,x\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________